<?php
namespace haibao\cms\business\control\wap\search;

class KeywordsController extends \haibao\cms\business\control\Base{
    public function __construct($updateTime = null,$controlId,$isPublish){
        parent::__construct($updateTime,$controlId,$isPublish);
    }
    
    public function displayTemplateHtml(){
        $controlData = $this->getParameter(self::$CONTROL_DATA);
        $autoData = array();
        if($controlData['auto']){
            foreach($controlData['auto'] as $key=>$val){
                $resultData =json_decode($val['ParameterValue']);
                if(isset($resultData->showOrder)){
                    $autoData[$resultData->showOrder] = array('Keyword'=>$resultData->Keyword,
                                                               'Url'=>$resultData->Url);
                }else{
                    array_push($autoData,array('Keyword'=>$resultData->Keyword,'Url'=>$resultData->Url));
                }
            }
        }
        return $autoData;
    }
}